![]() |
MakeRGBPat |
||||
Header: | Quickdraw.h | Carbon status: | Supported | |
Creates the appearance of otherwise unavailable colors on indexed devices.
void MakeRGBPat ( PixPatHandle pp, const RGBColor *myColor );
On return, a handle to the generated pixel pattern.
An RGBColor structure that defines the color you want to approximate.
The MakeRGBPat function generates a PixPat structure that approximates the color you specify in the myColor parameter. For example, if your application draws to an indexed device that supports 4 bits per pixel, you only have 16 colors available if you simply set the foreground color and draw. If you use MakeRGBPat to create a pattern, and then draw using that pattern, you effectively get 125 different colors. If the graphics device has 8 bits per pixel, you effectively get 2197 colors. (More color are theoretically possible; this implementation opted for a fast pattern selection rather than the best possible pattern selection.)
For a pixel pattern, the (**patMap).bounds field of the PixPat structure always contains the values (0,0,8,8), and the (**patMap).rowbytes field equals 2.
Because patterns produced with MakeRGBPat aren’t usually solid—they provide a selection of colors by alternating between colors, with up to four colors in a pattern— lines that are only one pixel wide may not look good.
When MakeRGBPat creates a ColorTable structure, it fills in only the rgb fields of its ColorSpec structures; the value fields are computed at the time the drawing actually takes place, using the current pixel depth for the system.
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)